package com.aaa.controller;

import com.aaa.dao.UserMapper;
import com.wsc.entity.User;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("user")
public class UserController {
    @Resource
    UserMapper userMapper;
    @RequestMapping("find")
    public Object select(){
        return userMapper.selectList(null);
    }
    @RequestMapping("insert")
    public Object insert(User user){
        return userMapper.insert(user);
    }
    @RequestMapping("delete")
    public Object delete(Integer uid){
        return userMapper.deleteById(uid);
    }
    @RequestMapping("update")
    public Object update(User user){
        return userMapper.updateById(user);
    }
}
